# TODO: Add comment
# 
# Author: ryan
###############################################################################

#rm(list=ls());
# load qcc package.
library(qcc);
#windows();
graphics.off();
#rm(list=ls());



setwd("C:/carmd-cvs02/Koala");

png(filename="./DynamicWebPage/ParetoChart.png",width = 450, height = 300);
# read source data
datasource<-read.table("./DataSource/ParetoChart.txt",header=TRUE);
# get the header name, will be used as the title of the chart.
attach(datasource);
#ChartTitle<-names(datasource[1]);
defect<-Frequency;
names(defect)<-ErrorCode;
#measurement<-qcc.groups(datasource[,1],sample);

par(bg="lightsteelblue");
pareto.chart(defect,col=rainbow(length(defect)));


dev.off();
